package com.zp.io;

import java.io.File;

public class FileTest4 {
	public static void main(String[] args) {
		File file = new File("D:/zp/hello");
		
		String[] name = file.list();
		//根据要求遍历文件：遍历结尾是.java的文件
		for(String names : name){
			if(names.endsWith(".java"))
			System.out.println(names);
		}
	}
}
